package com.provider.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.provider.dao.TPlaneDao;
import com.provider.entity.TPlane;
import com.provider.service.TPlaneService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 项目计划主表(TPlane)表服务实现类
 *
 * @author makejava
 * @since 2024-04-28 17:47:45
 */
@Service("tPlaneService")
@Transactional(rollbackFor = Exception.class)
public class TPlaneServiceImpl extends ServiceImpl<TPlaneDao, TPlane> implements TPlaneService {
    @Resource
    TPlaneDao planeDao;

    @Override
    public TPlane queryProjectPlanBySystemId(String systemId) {
        LambdaQueryWrapper<TPlane> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TPlane::getSystemId, systemId).eq(TPlane::getIsValid,"Y");
        return this.getOne(lambdaQueryWrapper);
    }

    @Override
    public List<TPlane> queryAllProjectPlan() {
        LambdaQueryWrapper<TPlane> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TPlane::getIsValid,"Y");
        return this.list(lambdaQueryWrapper);
    }
}

